<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function queryParse(url) {

            console.log(url);
            const data=url.split('?')[1].split("&").map(item=>item.replace("=",":"))
            const dataRes={...data}
            return dataRes
        }
        const ur = "https://www.baidu?width=251&height=360&pdi=85#name"
        const parms = queryParse(ur)
        console.log(parms)//{width:251,height:360,pdi:85}
    </script>
</body>

</html>